
#include "ogl/gut/MeshDesc2.h"
#include "ogl/gut/Dictionary.h"
#include "ogl/gut/VertexArray.h"
#include "imgui/Editor.h"

using namespace Ogl::Gut;

template <>
bool ImGui::Editor::Edit(const std::string &label, Ogl::Gut::MeshDesc2::HD &inst)
{
    int index = 0;
    if (TreeNode(label.c_str(), inst.m_BitFlag, index++))
    {

        ComboInst<Ogl::Gut::VertexType, Ogl::Gut::VertexTypeDesc>("VertexType", Dictionary::m_VertexDescs, inst.m_VertexType);
        ComboInst<Ogl::Gut::IndexType, Ogl::Gut::IndexTypeDesc>("IndexType", Dictionary::m_IndexDescs, inst.m_IndexType);
        ComboInst<Ogl::Gut::ModeType, Ogl::Gut::ModeTypeDesc>("ModeType", Dictionary::m_ModeDescs, inst.m_ModeType);
        EditInst("NumVertexFixed", inst.m_NumVerticesFixed);
        EditInst("NumVertexSkinned", inst.m_NumVerticesSkinned);
        EditInst("NumVertexFont", inst.m_NumVerticesFont);
        EditInst("NumIndices8", inst.m_NumIndices8);
        EditInst("NumIndices16", inst.m_NumIndices16);
        EditInst("NumIndices32", inst.m_NumIndices32);

        TreePop();
    }

    return false;
};

template <>
bool ImGui::Editor::Edit(const std::string& label, Ogl::Gut::MeshDesc2& inst)
{
    int index = 0;
    if (TreeNode(label.c_str(), inst.m_BitFlag, index++))
    {
        EditInst("HD", inst.m_HD);
        TreePop();
    }
    return false;
};

